<?php
	echo $this->Html->script('jquery.lightbox-0.5.pack');
	echo $this->Html->css('jquery.lightbox-0.5');
	$col = 4;
	$row = ceil(count($projects)/$col);
?>

<div class="items">
	<table class="no-border" width="100%">
		<?php for($m =0; $m<$row; $m++) { ?>
		<tr>
			<?php for($n =0; $n<$col; $n++) { ?>
				<td class="project" align="center" width="25%">
					<?php
					if(isset($projects[$m * $col + $n])) {
						$item = $projects[$m * $col + $n];
					?>
					 <a href="<?php echo Router::url('/img/project/'.$item['Picture']['image_link']); ?>" title="<?php echo $item['Picture']['name_'.$lang];?>"  class="lightbox">
            			<img src="<?php echo Router::url('/img/project/thumb/'.$item['Picture']['image_link']); ?>"/>
						<p align="center"><?php echo $item['Picture']['name_'.$lang];?></p>
        			</a>
            		<?php
					}
					?>
				</td>
			<?php } ?>
		</tr>
		<?php } ?>
	</table>
	<script type="text/javascript">
		$(function() {
			$('a.lightbox').lightBox();
		});
	</script>
	<?php echo $this->element('layouts/page_nav'); ?>
</div>